<template> 
     <a-row >
      <div ref="page" style="height:700px"> 
      <a-col :span="7">
        <a-card :bordered="false" style="width:100%"> 
          <div class="table-page-search-wrapper">
            <a-form layout="inline" @keyup.enter.native="searchQuery">
              <a-row :gutter="24">
                <a-input-search @search="onSearch" style="width:95%;margin-top: 10px;margin-left:20px" v-model="ryxm" placeholder="请输入人员姓名"/>  
              </a-row>
            </a-form>
          </div> 
          <div style="margin-left: 10px;margin-top: 5px;color: #6d0909;">初始化显示为10个人员信息，可使用姓名条件检索</div>
          <div style="height:700px;overflow-y:auto;margin-top:20px" ref="page">
            <a-tree
              v-if='treeData.length > 0'
              :tree-data="treeData"
              :defaultExpandAll="autoExpandParent"
              show-line
              @select="onSelect"
              :replaceFields="replaceFields" 
            >  
              <template #title="{ key: treeKey, title,level,choose,ryid,pid,mlid,orgcode }">
                <a-dropdown :trigger="['contextmenu']">
                  <span>{{ title }}</span>
                  <template #overlay>
                    <a-menu @click="({ key: menuKey }) => onContextMenuClick(treeKey, menuKey,level,title,choose,ryid,pid,mlid,orgcode)">
                      <a-menu-item key="1"  v-if="xzxx.dwid == loginOrgCode || xzxx.dwid == ''">新建</a-menu-item>
                      <a-menu-item key="2"  v-if="xzxx.dwid == loginOrgCode || xzxx.dwid == '' && level == '2'">修改</a-menu-item>
                      <a-menu-item key="3"  v-if="xzxx.dwid == loginOrgCode || xzxx.dwid == '' && level == '2'">删除</a-menu-item>
                    </a-menu>
                  </template>
                </a-dropdown>
              </template>
              <a-icon slot="switcherIcon" type="down" />
            </a-tree>  
          
          </div>
          <Da-Ml-Gl ref="DaMlGl" @ok="getrylist(ryxm)"></Da-Ml-Gl> 
          <da-ryxx-modal ref="modalForm" @ok="modalFormOk"></da-ryxx-modal>
        </a-card> 
      </a-col>
      <a-col :span="17">
         
        <a-card :bordered="false" style="width:100%;height: 810px;" v-if="lx == '人员'">  
              <a-row>
                <a-col :span="8">
                  <a-form-model-item label="姓名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="xm">
                    <a-input v-model="model.xm"  ></a-input>
                  </a-form-model-item>
                </a-col>
                <a-col :span="8">
                  <a-form-model-item label="身份证号" :labelCol="labelCol" :wrapperCol="wrapperCol"  prop="sfzh">
                    <a-input v-model="model.sfzh"    ></a-input>
                  </a-form-model-item>
                </a-col>
                <a-col :span="8">
                  <a-form-model-item label="性别" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="xb"> 
                    <j-dict-select-tag
                      type="list"
                      v-model="model.xb"
                      dictCode="xb" 
                      style="width:100%"
                    />
                  </a-form-model-item>
                </a-col>
                <a-col :span="8">
                  <a-form-model-item label="出生年月" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="csny">  
                    <a-input v-model="model.csny"    ></a-input>
                  </a-form-model-item>
                </a-col>
                <a-col :span="8">
                  <a-form-model-item label="民族" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="mz"> 
                    <j-dict-select-tag
                      type="list"
                      v-model="model.mz"
                      dictCode="mz"
                      style="width:100%"
                    />
                  </a-form-model-item>
                </a-col>
                <a-col :span="8">
                  <a-form-model-item label="联系电话" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="lxdh">
                    <a-input v-model="model.lxdh"   ></a-input>
                  </a-form-model-item>
                </a-col> 
                <a-col :span="8">
                  <a-form-model-item label="入伍时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="rwsj"> 
                    <a-input v-model="model.rwsj"    ></a-input> 
                  </a-form-model-item>
                </a-col>
                <a-col :span="8">
                  <a-form-model-item label="退伍时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="twsj"> 
                    <a-input v-model="model.twsj"    ></a-input> 
                  </a-form-model-item>
                </a-col>
                <a-col :span="8">
                  <a-form-model-item label="政治面貌" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="zzmm">  
                    <a-input v-model="model.zzmm"  ></a-input> 
                  </a-form-model-item>
                </a-col>
                <a-col :span="8">
                  <a-form-model-item label="入党时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="rdsj"> 
                    <a-input v-model="model.rdsj"    ></a-input> 
                  </a-form-model-item>
                </a-col>
                
                <a-col :span="8">
                  <a-form-model-item label="健康状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="jkzt"> 
                    <a-input v-model="model.jkzt"  ></a-input>  
                  </a-form-model-item>
                </a-col>
                <a-col :span="8">
                  <a-form-model-item label="残疾性质" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cjxz"> 
                    <a-input v-model="model.cjxz"   ></a-input>   
                  </a-form-model-item>
                </a-col>
                <a-col :span="24">
                  <a-form-model-item label="入伍地" :labelCol="onelabelCol" :wrapperCol="onewrapperCol" prop="rwd">  
                    <a-input v-model="model.rwd"   ></a-input> 
                  </a-form-model-item>
                </a-col>
                <a-col :span="24">
                  <a-form-model-item label="拟安置地" :labelCol="onelabelCol" :wrapperCol="onewrapperCol" prop="nazd"> 
                    <j-select-depart v-model="model.nazd1"  placeholder="请选择拟安置地" />
                    <a-input v-model="model.nazd"    ></a-input>              
                  </a-form-model-item>
                </a-col>
                <a-col :span="8">
                  <a-form-model-item label="部队代号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="bddh">
                    <a-input v-model="model.bddh" ></a-input>
                  </a-form-model-item>
                </a-col>
                <a-col :span="8">
                  <a-form-model-item label="退伍证号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="twzh">
                    <a-input v-model="model.twzh"  ></a-input>
                  </a-form-model-item>
                </a-col>
                <a-col :span="8">
                  <a-form-model-item label="安置方式" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="azfs"> 
                    <a-input v-model="model.azfs"   ></a-input> 
                  </a-form-model-item>
                </a-col>
                <a-col :span="8">
                  <a-form-model-item label="军龄" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="jl">
                    <a-input v-model="model.jl"  ></a-input>
                  </a-form-model-item>
                </a-col>
                <a-col :span="8">
                  <a-form-model-item label="入伍高校名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="rwgxmc">
                    <a-input v-model="model.rwgxmc" ></a-input>
                  </a-form-model-item>
                </a-col>
                <a-col :span="8">
                  <a-form-model-item label="是否复学" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sffx"> 
                    <j-dict-select-tag
                      type="list"
                      v-model="model.sffx"
                      dictCode="is_open" 
                      style="width:100%"
                    />
                  </a-form-model-item>
                </a-col>
                <a-col :span="24">
                  <a-form-model-item label="学历情况" :labelCol="onelabelCol" :wrapperCol="onewrapperCol" prop="xlqk">   
                    <a-input v-model="model.xlqk"   ></a-input> 
                   
                  </a-form-model-item>
                </a-col>
                
                <a-col :span="24">
                  <a-form-model-item label="奖惩信息" :labelCol="onelabelCol" :wrapperCol="onewrapperCol" prop="jlxx">   
                    <a-input v-model="model.jlxx"   ></a-input> 
                  </a-form-model-item>
                </a-col>
                
              </a-row>
        </a-card>
        <a-card :bordered="false" style="width:100%;height: 810px;" v-if="lx == '目录'">
          <a-page-header
              :ghost="false"
              :title="xzxx.ryxm"
              :sub-title="xzxx.mlmc"
              
            >
              <!-- 查询区域 -->
              <div class="table-page-search-wrapper">
                <a-form layout="inline" >
                  <a-row :gutter="24">
                    <a-col :xl="12" :lg="7" :md="8" :sm="24">
                      <a-form-item label="文件名称">
                        <a-input placeholder="文件名称" v-model="wjmc" @keyup.enter.native="searchQuery"></a-input>
                      </a-form-item>
                    </a-col> 
                    <a-col :xl="12" :lg="7" :md="8" :sm="24">
                      <a-button @click="searchQuery" type="primary" icon="plus">查询</a-button>
                      <a-button @click="viewAllPic" type="primary" icon="database" style="margin-left:10px" v-if='dataSource.length>0'>浏览档案</a-button>
                      <a-button @click="UploadAdd" type="primary" icon="plus" style="margin-left:10px" v-if="xzxx.dwid == loginOrgCode || xzxx.dwid == ''">上传文件</a-button>
                      <a-button type="primary" icon="download" @click="handleExportXls('人员档案信息表')" style="margin-left:10px"  v-if="xzxx.dwid == loginOrgCode || xzxx.dwid == ''">导出当页列表</a-button>  
<!--                      <a-dropdown v-if="selectedRowKeys.length > 0" style="margin-left:10px">-->
<!--                        <a-menu slot="overlay">-->
<!--                          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/> v-if="xzxx.dwid == loginOrgCode || xzxx.dwid == ''">删除</a-menu-item>-->
<!--                        </a-menu>-->
<!--                        <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>-->
<!--                      </a-dropdown>-->
                    </a-col>
                  </a-row>
                </a-form>
              </div>
              <!-- 查询区域-END -->

              <!-- 操作按钮区域 -->
              <!-- <div class="table-operator">
                
              </div> -->
              
              <div>
                <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
                  <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
                  <a style="margin-left: 24px" @click="onClearSelected">清空</a>
                </div>

                <a-table
                  ref="table"
                  size="middle"
                  :scroll="{x:true}"
                  bordered
                  rowKey="id"
                  :columns="columns"
                  :dataSource="dataSource"
                  :pagination="ipagination"
                  :loading="loading"
                  :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
                  class="j-table-force-nowrap"
                  @change="handleTableChange">

                  <template slot="htmlSlot" slot-scope="text">
                    <div v-html="text"></div>
                  </template>
                  <template slot="imgSlot" slot-scope="text,record">
                    <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
                    <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
                  </template>
                  <template slot="fileSlot" slot-scope="text">
                    <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
                    <a-button
                      v-else
                      :ghost="true"
                      type="primary"
                      icon="download"
                      size="small"
                      @click="downloadFile(text)">
                      下载
                    </a-button>
                  </template>

                  <span slot="action" slot-scope="text, record">
                    <a @click="handleEdit(record)"  v-if="xzxx.dwid == loginOrgCode || xzxx.dwid == ''">编辑</a>
                    <a-divider type="vertical"   />
                    <a @click="viewdapic(record)" >查看</a>
                    <a-divider type="vertical"  v-if="xzxx.dwid == loginOrgCode || xzxx.dwid == ''"/>
                    <a-popconfirm title="确定作废吗?" @confirm="() => handleDelete(record)"  v-if="xzxx.dwid == loginOrgCode || xzxx.dwid == ''">
                      <a>作废</a>
                    </a-popconfirm>
                  
                  </span>

                </a-table>
              </div>
          </a-page-header>
          <Wj-Upload ref="WjUpload" @ok="loadData"></Wj-Upload> 
          <da-mlwj-modal ref="modalForm" @ok="modalFormOk"></da-mlwj-modal>
        </a-card>  
         
      </a-col>
       <template>
         <div v-for="(fileDetail,index) in images" :key="index">
           <div style="float: left;width:104px;height:134px;margin-right: 10px;margin: 0 8px 8px 0;">
             <div
               style="width: 100%;height: 100%;position: relative;padding: 8px;border: 1px solid #d9d9d9;border-radius: 4px;">
               <img style="width: 100%;height: 100%;" :src="fileDetail"  @click="onclickImg(fileDetail)" :preview="images">
             </div>
           </div>
         </div>
       </template>
      </div>
    </a-row> 
    <!-- <a-flex vertical="horizontal">
      
    </a-flex> -->
    
</template>

<script>
  import { ref } from 'vue';
  import Vue from 'vue'
  import '@/assets/less/TableExpand.less' 
  import { pushIfNotExist, filterObj } from '@/utils/util'
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import DaRyxxModal from './modules/DaRyxxModal' 
  import { httpAction, getAction,deleteAction } from '@/api/manage' 
  import DaMlGl from './modules/Damlgl.vue' 
  import WjUpload from './modules/WjUpload.vue'
  import DaMlwjModal from './modules/DaMlwjModal'
  import store from '@/store/'
  import Watermark from '@/utils/watermark'
  import 'viewerjs/dist/viewer.css'
  import VueViewer from 'v-viewer'
  // 全局配置
  VueViewer.setDefaults({
    zIndex: 9999, // 图片查看器的层级
    navbar: true, // 隐藏导航栏
    keyboard:true,
    toolbar: {
      zoomIn: true,
      zoomOut: true,
      oneToOne: true,
      reset: true,
      prev:true,
      next:true,
      play: true,
      rotateLeft: true,
      rotateRight: true,
      flipHorizontal: true,
      flipVertical: true,
       
    },
  })
  Vue.use(VueViewer)
  export default {
    name: 'DaRyxxList',
    mixins:[JeecgListMixin, mixinDevice],
    components: {
      DaRyxxModal,
      DaMlGl,
      WjUpload,
      DaMlwjModal
    },
    data () {
      return {
        ryxm:"",
        spinning:true,
        autoExpandParent:false,
        allTreeKeys:[],
        showImageViewer:false,
        srcList:[],
        xzxx:{
          ryxm:"",
          mlmc:"",
          ryid:"",
          mlid:"",
          id:"",
          dwid:""
        },
        wjmc:'',
        model:{
          xm:"",
          sfzh:"",
          xb:"",
          csny:"",
          mz:"",
          lxdh:"",
          rwsj:"",
          twsj:"",
          zzmm:"",
          rdsj:"",
          jkzk:"",
          cjxz:"",
          rwd1:"",
          rwd:"",
          nazd1:"",
          nazd:"",
          bddh:"",
          twzh:"",
          azfs:"",
          jl:"",
          rwgxmc:"",
          sffx:"",
          xlqk:"",
          xlqk1:"",
          jcxx:"",
          jcxx1:"",
          mlmb:"",
        },
        onelabelCol: {
          xs: { span: 24 },
          sm: { span: 3 },
        },
        onewrapperCol: {
          xs: { span: 24 },
          sm: { span: 21 },
        },
        twolabelCol: {
          xs: { span: 4 },
          sm: { span: 5 },
        },
        twowrapperCol: {
          xs: { span: 24 },
          sm: { span: 19 },
        },
        labelCol: {
          xs: { span: 24 },
          sm: { span: 9 },
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 15 },
        },
        NodeTreeItem:null,
        tmpStyle:'',
        replaceFields:{
          children:'children', title:'title', key:'key' // 看你的接口返回字段是什么，对应匹配就行了
        }, 
        treeData:[],
        description: '人员档案信息表管理页面',
        queryParam:[],
        dataSource:[],
        // 表头
        columns: [
          // {
          //   title: '#',
          //   dataIndex: '',
          //   key:'rowIndex',
          //   width:60,
          //   align:"center",
          //   customRender:function (t,r,index) {
          //     return parseInt(index)+1;
          //   }
          // },
          
          {
            title:'目录名称',
            align:"center",
            dataIndex: 'mlmc'
          },
          {
            title:'文件名称',
            align:"center",
            dataIndex: 'wjmc'
          },
       
          {
            title:'顺序',
            align:"center",
            dataIndex: 'sx'
          },
          {
            title:'上传人',
            align:"center",
            dataIndex: 'createBy_dictText'
          },
          {
            title:'上传时间',
            align:"center",
            dataIndex: 'createTime'
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            fixed:"right",
            width:147,
            scopedSlots: { customRender: 'action' }
          }
        ],
        url: {
          list: "/mlwj/daMlwj/list",
          delete: "/mlwj/daMlwj/delete",
          deleteBatch: "/mlwj/daMlwj/deleteBatch",
          exportXlsUrl: "/mlwj/daMlwj/exportXls",
          importExcelUrl: "mlwj/daMlwj/importExcel",
          rydaml: "dary/daRyxx/rylist",
          del:"/dary/daRyxx/rymldel",
          queryById: "/dary/daRyxx/queryById",
        },
        imageList: [
          {
            url:
              'http://192.168.2.7:8021/2023-11-23/1700731546019c5cd18f0cfcfbc848639b2a7fbcb18a.jpg',
            title: '寄件方资料-合同'
          },
          {
            url:
              'http://192.168.2.7:8021/2023-11-24/17007886516555103.jpg',
            title: '收件方资料-发票'
          }
        ],
        lx:'',
        dictOptions:{},
        superFieldList:[],
        /* 分页参数 */
        ipagination: {
          current: 1,
          pageSize: 10,
          pageSizeOptions: [ '10', '20', '30'],
          showTotal: (total, range) => {
            return range[0] + '-' + range[1] + ' 共' + total + '条'
          },
          showQuickJumper: true,
          showSizeChanger: true,
          total: 0
        },
        isorter: {
          column: 'create_time',
          order: 'desc'
        },
        loginOrgCode:"",
        images:[]
      }
    },
    created() {
      console.log("传递参数",this.$route.params);
      if (this.$route.params.isZhanKai === "yes")
      {
        this.ryxm = this.$route.params.xm;
      }
       this.autoExpandParent = this.$route.params.isZhanKai === "yes";
       console.log("自动展开",this.autoExpandParent)
       this.loginOrgCode = store.getters.userInfo.orgCode;
       this.getSuperFieldList();
       this.getrylist(this.ryxm)
       this.lx = "";
       setTimeout(() => {
          Watermark.set(store.getters.water , this.$refs.page)
          // Watermark.set(store.getters.water , this.$refs.page1)
        }, 1000);
    },
    watch:{
      $route(to,from) { //路由变化方式，路由发生编号，方法就会执行 

          if (this.$route.params.isZhanKai === "yes")
          {
            this.ryxm = this.$route.params.xm;
          }
          this.autoExpandParent = this.$route.params.isZhanKai === "yes";
          console.log("自动展开",this.autoExpandParent)
          this.loginOrgCode = store.getters.userInfo.orgCode;
          this.getSuperFieldList();
          this.getrylist(this.ryxm);
          this.lx = "";
          setTimeout(() => {
              Watermark.set(store.getters.water , this.$refs.page)
              // Watermark.set(store.getters.water , this.$refs.page1)
            }, 1000);

      }
    },
    computed: {
      importExcelUrl: function(){
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      },
    },
    methods: {
      postwj(imglist){
        console.log(imglist)
      },
      // 递归所有父节点默认展开
      getFatherKeys(list) {
        var keys = [];
        let find = function (arr) {
          for (var i = 0; i < arr.length; i++) {
            var item = arr[i];
            if (item.children.length > 0) {
              keys.push(item.id);
              find(item.children);
            }
          }
        };
        find(list);
        return keys;
      },       
      viewdapic(record){ 
        console.log(record.wjdz)
        this.ImageFull(record.wjdz)
      },
      handleEdit(record){
        this.$refs.modalForm.edit(record);
        this.$refs.modalForm.title = "编辑";
        this.$refs.modalForm.disableSubmit = false; 
      },
      handleDelete(record){
        let that = this;
        deleteAction(that.url.delete, {id: record.id}).then((res) => {
          if (res.code == "0") {
            //重新计算分页问题 
            that.$message.success(res.msg);
            that.loadData();
          } else {
            that.$message.warning(res.message);
          }
        }); 
      },
      UploadAdd(){       
          
        this.$refs.WjUpload.show(this.xzxx.id);
      },
      searchQuery(){ 
        this.loadData();
      },
      getQueryParams(getAll) {
        let param = Object.assign({}, this.queryParam, this.isorter);
        param.field = this.getQueryField();
        if (getAll){
          param.pageNo = 1;
          param.pageSize = -1;
        } else {
          param.pageNo = this.ipagination.current;
          param.pageSize = this.ipagination.pageSize;
        }
        // param.departId = this.selectedDepIds.join(',')
        return filterObj(param);
      },
      handleTableChange(pagination, filters, sorter){
        console.log(pagination)
        // if (Object.keys(sorter).length > 0) {
        //   this.isorter.column = sorter.field;
        //   this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
        // }
        this.ipagination = pagination;
        this.loadData();
      },
      loadData(){  
          let params = this.getQueryParams(false)//查询条件

          this.loading = true 
          getAction(this.url.list+'?ryid='+this.xzxx.ryid+'&mlid='+this.xzxx.id+'&wjmc='+this.wjmc, params).then((res) => {
            console.log("res",res)
            if (res.success) {
              console.log("ok")
              this.dataSource = res.result.records;
              this.ipagination.total = res.result.total;
            }
            if(res.code===510){
              this.$message.warning(res.message)
            }
            this.loading = false;
          })
          
      },
      onSearch(){
        this.getrylist(this.ryxm)
      },
      getrylist(ryxm){
        let data = { ryxm : ryxm};
        this.loading = true
        this.treeData = [];
        httpAction(this.url.rydaml,data,'post').then((res)=>{ 
           this.treeData = res;
           console.log("列表",this.treeData);
          // this.dataExpandedKeys = this.getFatherKeys(this.treeData)
          if (this.treeData !== null && this.treeData.length > 0 && this.autoExpandParent){
 
            this.lx = '人员';
            this.getryxx(this.treeData[0].ryid);
          }
          }).finally(() => { 
            this.loading = false;
        }) 
      }, 
      getryxx(id){
        httpAction(this.url.queryById+"?id="+id,'','get').then((res)=>{ 
           console.log("返回信息",res)
           if (res.success){
            this.model = res.result;
           }else{
            this.$message.error("查无该人信息");
           }
          }).finally(() => { 
        })
      },
      ImageFull(daurl){
        this.srcList = [daurl]
        this.$viewerApi({
          images: this.srcList,
        })
        this.showImageViewer = true;
      },
      viewAllPic(){
        this.srcList = []
        if (this.dataSource.length > 0){
          let params = this.getQueryParams(true)//查询条件
          this.loading = true
          getAction(this.url.list+'?ryid='+this.xzxx.ryid+'&mlid='+this.xzxx.id+'&wjmc='+this.wjmc, params).then((res) => {
            if (res.success) {
              for (let i = 0; i < res.result.records.length; i++) {
                this.srcList.push(res.result.records[i].wjdz)
              }
              console.log(this.srcList)
              this.$viewerApi({
                images: this.srcList,
              })
              this.showImageViewer = true;
            }
            if(res.code===510){
              this.$message.warning(res.message)
            }
            this.loading = false;
          })
        }
      },

      onContextMenuClick(treeKey, menuKey,level,title,choose,ryid,pid,mlid,orgcode) {
        this.xzxx.dwid = orgcode;
        console.log("菜单",orgcode) 
        console.log("登录orgcode",this.loginOrgCode) 
        if (this.loginOrgCode == orgcode  || orgcode  == ""){
          switch(menuKey){
            case "1":
              this.$refs.DaMlGl.show(treeKey, menuKey,level,title,choose,ryid,pid,mlid);
              break;
            case "2":
              this.$refs.DaMlGl.show(treeKey, menuKey,level,title,choose,ryid,pid,mlid);
              break;
            case "3":
              let data = {
                            treeKey:treeKey,
                            ryid:ryid,
                            mlid:mlid
                        }
              this.$confirm({
                  content: '是否删除？',
                  onOk: () => {
                    httpAction(this.url.del,data,'post').then((res)=>{
                        if(res.code == "0"){
                          this.getrylist(this.ryxm)
                        }else{
                          this.$message.error(res.msg);
                        }
                      }).finally(() => {
                    })
                  },
                })
              break;
            case "4":
          }
        }else{
          this.$message.error("您没有权限操作！");
        }

        console.log(`treeKey: ${treeKey}, menuKey: ${menuKey}, level: ${level}, title: ${title}, choose: ${choose}`);
      },
      onSelect(selectedKeys, info){
        let level = info.selectedNodes[0].data.props.level;
        switch (level) {
          case "1":
            this.lx = '人员'; 
            this.getryxx(info.selectedNodes[0].data.props.ryid); 
            break;
          case "2":
            this.lx = '目录'; 
            this.xzxx.ryxm = info.selectedNodes[0].data.props.choose;
            this.xzxx.mlmc = info.nativeEvent.srcElement.innerText; 
            this.xzxx.ryid = info.selectedNodes[0].data.props.ryid;
            this.xzxx.mlid = info.selectedNodes[0].data.props.mlid;
            this.xzxx.id   = info.selectedNodes[0].data.props.rymlid;
            this.xzxx.dwid = info.selectedNodes[0].data.props.orgcode;
            this.loadData(); 
            
            console.log('目录信息',this.xzxx,info.selectedNodes[0].data.props.orgcode,this.xzxx.dwid)
            
            break;        
          case "3":
            
            break;
        }
        console.log('selected', selectedKeys, info);
        // console.log('selected-code',info.selectedNodes[0].data.props.code)
      },
      initDictConfig(){
      },
      getSuperFieldList(){
        let fieldList=[];
        fieldList.push({type:'string',value:'mlid',text:'目录ID'})
        fieldList.push({type:'string',value:'mlmc',text:'目录名称'})
        fieldList.push({type:'string',value:'wjmc',text:'文件名称'})
        fieldList.push({type:'string',value:'wjdz',text:'文件地址'})        
        fieldList.push({type:'int',value:'sx',text:'顺序'})
        fieldList.push({type:'string',value:'createBy_dictText',text:'上传人'})
        fieldList.push({type:'string',value:'createTime',text:'上传时间'})
        this.superFieldList = fieldList
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>